
def h(nu):
    for i in range(len(nu)-1):
        for j in range(len(nu)-2, i-1, -1):
            if nu[j+1]<nu[j]:
                nu[j], nu[j+1]=nu[j+1], nu[j]
    return(nu)

def F(filename):
    h=open(filename, 'r')
    g=h.readlines()
    h.close
    return g

def a(q):
    u=list(map(int, q))
    return u

from time import*

l=F('1.txt')
k=F('20.txt')
p=F('5.txt')


lu=a(l)
ku=a(k)
pu=a(p)

ts=time()
print(h(lu))
tk=time()
print('Vremya', round((tk-ts)*1000), 'milliseconds')

ts=time()
print(h(ku))
tk=time()
print('Vremya', round((tk-ts)*1000), 'milliseconds')

ts=time()
print(h(pu))
tk=time()
print('Vremya', round((tk-ts)*1000), 'milliseconds')
